package com.btrh.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Properties;

public class PropUtils {
    private static Logger logger = LoggerFactory.getLogger(PropUtils.class);
    private static Properties properties;
    static {
        if (properties!=null) {
        }
        else {
            InputStream in = null;
            try {
                properties = new Properties();
                in = PropUtils.class.getClassLoader().getResourceAsStream("config.properties");
                BufferedReader br= new BufferedReader(new InputStreamReader(in));
                properties.load(br);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    public static  String  getProp(String key){
        return properties.getProperty(key);
    }
}
